// 数据库连接模块
// use mysql::*;
// use mysql::prelude::*;
// use std::error::Error;
//
// fn main() -> Result<(), Box<dyn Error>> {
//     // 创建连接选项
//     let url = "mysql://root:Lichuandi0911@localhost:3306/lichaundi";
//     let opts = Opts::from_url(url)?;
//     let pool = Pool::new(opts)?;
//
//     // 获取连接
//     let conn = pool.get_conn()?;
//
//     // 执行SQL查询
//     let out: (String, i32) = mysql::from_row(conn.query_first("SELECT user_name, password FROM tb_user WHERE id=1", ())?);
//     println!("Name: {}, Age: {}", out.0, out.1);
//
//     Ok(())
// }
pub fn db_conn() {
//    println!("Hello, world!");
//           let url = "mysql://root:Lichuandi0911@localhost:3306/lichuandi";
//        let opts = Opts::from_url(url)?;
//        let pool = Pool::new(opts)?;
//           let pool = Pool::new(url).expect("连接数据库失败");
//           let mut  conn = pool.get_conn().expect("获取连接失败");
          // 执行SQL查询
         //  let out: (String, i32) = mysql::from_row(conn.query_first("SELECT user_name, password FROM tb_user WHERE id=1", ()).expect("查询失败"));
         //  println!("Name: {}, Age: {}", out.0, out.1);
         // let result : Vec<(String,String)> = conn.query("SELECT user_name, password FROM tb_user").expect("执行查询失败");
         //
         // for (user_name,password) in result {
         //    print!("user_name:{},password:{}",user_name,password)
         //
         // }

}
